package com.joinway.admin.platform;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.web.context.ConfigurableWebApplicationContext;

public class PlatformAdminProfileInitializer implements ApplicationContextInitializer<ConfigurableWebApplicationContext> {

	private final static Logger log = LoggerFactory.getLogger(PlatformAdminProfileInitializer.class);
	
	@Override
	public void initialize(ConfigurableWebApplicationContext ctx) {
		if(PlatformAdmin.isCompactMode){
			log.info("reset current profile to [compact]");
			ctx.getEnvironment().setActiveProfiles("compact");
		}
	}

}
